package com.bizzard.product.domain;

import java.math.BigDecimal;
import java.util.Date;
import com.bizzard.basic.domain.BaseDomain;
import com.fasterxml.jackson.annotation.JsonFormat;

/**
 * 实体类：
 */
public class Product extends BaseDomain{

    private static final long serialVersionUID = 1L;

    /**
     * 服务名称
     */
    private String name;
    /**
     * 成本价
     */
    private String costprice;
    /**
     * 售价
     */
    private BigDecimal saleprice;
    /**
     * 存放fastdfs地址，多个资源使用，分割
     */
    private String resources;
    /**
     * 销售数量
     */
    private Long salecount;
    /**
     * 状态：0下架 1上架
     */
    private Long state = 0L;
    /**
     * 下架时间
     */
    @JsonFormat(pattern = "yyyy年MM月dd日 HH:mm:ss",timezone = "GMT+8")
    private Date offsaletime ;
    /**
     * 上架时间
     */
    @JsonFormat(pattern = "yyyy年MM月dd日 HH:mm:ss",timezone = "GMT+8")
    private Date onsaletime = new Date();
    @JsonFormat(pattern = "yyyy年MM月dd日 HH:mm:ss",timezone = "GMT+8")
    private Date createtime = new Date();

    private ProductDetail detail;



    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getCostprice() {
        return costprice;
    }

    public void setCostprice(String costprice) {
        this.costprice = costprice;
    }

    public BigDecimal getSaleprice() {
        return saleprice;
    }

    public void setSaleprice(BigDecimal saleprice) {
        this.saleprice = saleprice;
    }

    public String getResources() {
        return resources;
    }

    public void setResources(String resources) {
        this.resources = resources;
    }

    public Long getSalecount() {
        return salecount;
    }

    public void setSalecount(Long salecount) {
        this.salecount = salecount;
    }

    public Long getState() {
        return state;
    }

    public void setState(Long state) {
        this.state = state;
    }

    public Date getOffsaletime() {
        return offsaletime;
    }

    public void setOffsaletime(Date offsaletime) {
        this.offsaletime = offsaletime;
    }

    public Date getOnsaletime() {
        return onsaletime;
    }

    public void setOnsaletime(Date onsaletime) {
        this.onsaletime = onsaletime;
    }

    public Date getCreatetime() {
        return createtime;
    }

    public void setCreatetime(Date createtime) {
        this.createtime = createtime;
    }

    public ProductDetail getDetail() {
        return detail;
    }

    public void setDetail(ProductDetail detail) {
        this.detail = detail;
    }

    @Override
    public String toString() {
        return "Product{" +
        ", name=" + name +
        ", costprice=" + costprice +
        ", saleprice=" + saleprice +
        ", resources=" + resources +
        ", salecount=" + salecount +
        ", state=" + state +
        ", offsaletime=" + offsaletime +
        ", onsaletime=" + onsaletime +
        ", createtime=" + createtime +
        "}";
    }
}
